package cn.edu.neusoft.yuejian_02.model;

import java.util.List;

import cn.edu.neusoft.yuejian_02.bean.ActivityBean;
import cn.edu.neusoft.yuejian_02.listener.RetrofitListener;
import cn.edu.neusoft.yuejian_02.service.ActivityService;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by jj on 2017/10/8.
 */

public class ActivityModel extends BaseModel{

    public void ActivityList(final RetrofitListener listener){


        ActivityService service=retrofit.create(ActivityService.class);
        Call call = service.ActivityList();
        call.enqueue(new Callback() {
            @Override
            public void onResponse(Call call, Response response) {
                List<ActivityBean> userBean = (List<ActivityBean>) response.body();
                listener.onSuccess(userBean);
            }

            @Override
            public void onFailure(Call call, Throwable t) {
                listener.onFail();
            }
        });

    }


}
